package csu.fun.spring_store;

import csu.fun.spring_store.domain.Order;
import csu.fun.spring_store.domain.OrderVO;
import csu.fun.spring_store.persistence.OrderMapper;
import csu.fun.spring_store.web.controller.OrderController;
import org.junit.jupiter.api.Test;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@SpringBootTest
@MapperScan("csu.fun.spring_store")
public class demo {
    @Autowired
    private OrderMapper orderMapper;



    @Test
    public void test1()
    {
        List<Order> orders = orderMapper.selectList(null);

        System.out.println(orders);

    }
    @Test
    public void testSelectOrders()
    {

        List<OrderVO> orderVOS = orderMapper.selectOrders();
        for(int i=0;i<orderVOS.size();i++)
        {
            OrderVO h=orderVOS.get(i);
            System.out.println(h);
        }



    }
}
